#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 21-3-10 上午10:06
# @Author  : zgd
# @Site    : 
# @File    : config.py
# @Software: PyCharm
import logging
from redis  import StrictRedis
from datetime import timedelta

class Config():
    DEBUG = True

    # 数据库配置信息
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:mysql@localhost:3306/info36"
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    #redis配置
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    #session信息
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT)  #session存在那咯
    SESSION_USE_SIGNER = True #签名
    PERMANENT_SESSION_LIFETIME = timedelta(days=2)
    SECRET_KEY = 'SDASdasdasdasda'
    LEVEL_NAME = logging.DEBUG



class DevelopConfig(Config):
    DEBUG = True
    LEVEL_NAME = logging.DEBUG

class ProductConfig(Config):
    DEBUG = False
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:mysql@localhost:3306/Product"
    LEVEL_NAME = logging.ERROR

class TestConfig(Config):
    DEBUG = False


config_dict = {
    'develop':DevelopConfig,
    'product':ProductConfig,
    'test':TestConfig

}




























